package org.dallasrowing.logbook;

import java.io.FileInputStream;
import java.sql.Connection;
import java.util.HashMap;
import java.util.Properties;

import org.dallasrowing.logbook.report.GenerateJasperReport;
import org.dallasrowing.logbook.util.DBConnector;


public class CreateReport {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Config.conf = new Properties();
		try {
			Config.conf.load(new FileInputStream("data/logbook.properties"));

			Connection con = DBConnector.getConnection();
			GenerateJasperReport rep = new GenerateJasperReport(con, "reports/MetersErgedYTD2.jrxml");
			rep.generate(new HashMap<String,Object>());
			rep.exportPDF("report.pdf");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
